<%@ page import="org.ibiblio.terasaur.bt.Seedbank" %>
<html>
    <head>
        <meta name="layout" content="thin_sidebar" />
        <g:set var="entityName" value="Seedbank" />
        <content tag="title">${pageTitle}</content>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="list" action="list">Seed bank list</g:link></span> |
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
<% if (seedbankInstance) { %>
        <div class="clear"></div>
        <div class="rule"><hr /></div>

        <div class="body hentry">
            <h2 class="entry-title full-title">${seedbankInstance?.name}</h2>
            <div class="full full-content">
                <div class="entry-content full-content">Address: ${seedbankInstance?.ipAddress}:${seedbankInstance?.ipPort}</div>
                <div class="entry-content full-content">Peer id: ${seedbankInstance?.peerId}</div>
                <div class="entry-content full-content">This seed bank has ${seedbankInstance?.torrents.size().toString()} active torrents(s)</div>
                <div class="entry-content full-content">
                    <g:link action="torrents" id="${seedbankInstance?.id}" title="View seeded torrents list">View seeded torrents</g:link> |
                    <g:link action="torrents" id="${seedbankInstance?.id}" params="${[linked:0]}" title="View seeded torrents list">Add torrents</g:link>
                </div>

<g:if test="${canEdit}">
                <div class="edit edit-item">
                    <g:link action="edit" id="${seedbankInstance?.id}" title="Edit seed bank" class="edit-button">Edit</g:link>
                </div>
                <div class="edit delete-item">
                    <g:link action="delete" id="${seedbankInstance?.id}" title="Delete seed bank" class="edit-button"
                        onclick="return confirm('${message(code: 'default.button.delete.confirm.message')}');" >Delete</g:link>
                </div>
</g:if>
                <br/>
            </div>

            <div class="clear"></div>
            <div class="attribute left">
                <span class="by alt-font">Owned by</span> ${seedbankInstance?.owner.username}<br/>
                <span class="date full-date"> <span class="ndash alt-font">Created</span> <joda:format value="${seedbankInstance.dateCreated}" style="L-" /> |
                <span class="date full-date"> <span class="ndash alt-font">Last modified</span> <joda:format value="${seedbankInstance.lastUpdated}" style="L-" />
            </div>

            <div class="clear"></div>
            <div class="rule"><hr /></div>
         </div>
<% } // if seedbankInstance %>
    </body>
</html>
